package com.qingcloud.wcenter.api;

import com.qingcloud.wcenter.model.TablePageDTO;
import com.qingcloud.wcenter.model.sdata.dto.*;
import com.qingcloud.wcenter.model.sdata.params.MoDataParams;
import com.qingcloud.wcenter.model.sdata.params.MoDataTimeParams;
import com.qingcloud.wcenter.model.sdata.params.StationDataParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@FeignClient(name = "station-data-api", url = "${healthy.data-url}")
@RequestMapping("/sdata")
public interface StationDataApi {

    /**
     * 监测点IAQI均值改善率排行
     */
    @PostMapping(value = "/iaqi/rank")
    List<StationIaqiRankData> iaqiAvgSort(@RequestBody StationDataParams stationDataParams);

    /**
     * 监测点数据分页查询
     */
    @PostMapping(value = "/page")
    TablePageDTO<StationWeatherData> page(@RequestBody StationDataParams stationDataParams);

    /**
     * 分钟级别数据分页查询
     */
    @PostMapping(value = "/pageMinuteData")
    TablePageDTO<StationWeatherData> pageMinuteData(@RequestBody StationDataParams stationDataParams);

    /**
     * 监测点数据详细查询
     */
    @PostMapping(value = "/detail")
    StationWeatherData detail(@RequestBody StationDataParams stationDataParams);

    /**
     * 监测点实时数据查询(分钟级最新数据)
     */
    @PostMapping(value = "/realtime")
    TablePageDTO<StationWeatherData> realTime(@RequestBody StationDataParams stationDataParams);

    /**
     * 设备预警次数分页查询
     */
    @PostMapping(value = "/warn/count")
    TablePageDTO<StationWarnCountData> warnCount(@RequestBody StationDataParams stationDataParams);

    /**
     * 预警设备数量查询
     */
    @PostMapping(value = "/warn/station/num")
    Map<String, Integer> warnStationNum(@RequestBody StationDataParams stationDataParams);

    /**
     * 天和月数据实时聚合
     */
    @PostMapping(value = "/group")
    List<StationWeatherData> group(@RequestBody StationDataParams stationDataParams);

    /**
     * 船舶预警次数分页查询
     */
    @PostMapping(value = "/warn/mo/count")
    TablePageDTO<MoWarnCountData> warnMoCount(@RequestBody MoDataParams moDataParams);

    /**
     *航舶预警次数分页查询，按时间分组
     */
    @PostMapping(value = "/warn/mo/count/groupTime")
    TablePageDTO<MoWarnCountTimeData> warnMoCountGroupTime(@RequestBody MoDataTimeParams moDataParams);

    /**
     * 粒子数据聚合接口
     */
    @PostMapping(value = "/stationParticleData")
    List<StationWeatherData> stationParticleData(@RequestBody StationDataParams stationDataParams);

}
